<? if ($c = stack('name')) {

	$s = component_settings($c);

	?><section id="cpn-<?=$c?>" class="cpn-album"><?

	if ($s['caption']) { ?><hgroup class="cpn-album-caption"><?=$s['caption']?></hgroup><? }
	
	foreach($d = component_data($c) as $id => $v) {
		?><div id="cpn-<?=$c?>-<?=$id?>" class="block"><?

			if ($v['image']) { 
			
				?><a href="<?="$s[gparam]-$id/"?>" title="<?=h($v['alt'])?>" class="link image"><?
			
					?><img src="<?=$v['image']['fn']?>" width="<?=$v['image']['x']?>" height="<?=$v['image']['y']?>" alt="<?=h($v['alt'])?>" /><?
		
				?></a><?
			}
		
			?><h2><a href="<?="$s[gparam]-$id/"?>" title="<?=h($v['alt'])?>" class="link text"><?=$v['title']?></a></h2><?
				
			if ($v['body']) { 
				?><div class="text"><?=$v['body']?></div><?
			}
			
			?><div class="clearer"></div><?
					
		?></div><?
	} 
	
	?><div class="clearer"></div></section><?
	
unstack();
} ?>